<template>
  <div class='search'>
    <f-form ref='form' :action='api.hyOrderDetails.customUpdate' :labelWidth='4' :form-key='this.formItem.orderDetailsId'>
      <a-divider orientation='left' style='color: blue;font-weight: bold'>回款信息</a-divider>
      <f-form-item label='预收款' type='number' :precision='2' data-type='number' name='customYsk' :value='formItem.customYsk' />
      <f-form-item label='回款金额' type='number' :precision='2' data-type='number' name='returnAmount' :value='formItem.returnAmount' />
      <f-form-item label='回款日期' type='date' name='returnDate' :value='formItem.returnDate' />
      <f-form-item label='回款银行' name='returnBank' :value='formItem.returnBank' />
      <f-form-item label='回款账户' name='returnBankNo' :value='formItem.returnBankNo' />

      <a-divider orientation='left' style='color: blue;font-weight: bold'>保证金收款</a-divider>
      <f-form-item label='底价' type='number' :precision='2' data-type='number' name='customFloorAmount' :value='formItem.customFloorAmount' />
      <f-form-item label='高开金额' type='number' :precision='2' data-type='number' name='customGapUpAmount' :value='formItem.customGapUpAmount' />
      <f-form-item label='保证金应收金额' type='number' :precision='2' data-type='number' name='customBond' :value='formItem.customBond' />
      <f-form-item label='保证金收款金额' type='number' :precision='2' data-type='number' name='customBondTakeAmount' :value='formItem.customBondTakeAmount' />
      <f-form-item label='保证金收款日期' type='date' name='customBondDate' :value='formItem.customBondDate' />
      <f-form-item label='保证金款收款银行' name='customBondBankName' :value='formItem.customBondBankName' />
      <f-form-item label='保证金款收款账户' name='customBondBankNo' :value='formItem.customBondBankNo' />

      <a-divider orientation='left' style='color: blue;font-weight: bold'>退保证金</a-divider>
      <f-form-item label='退保证金日期' type='date' name='customBondRetDate' :value='formItem.customBondRetDate' />
      <f-form-item label='退保证金金额' type='number' :precision='2' data-type='number' name='customBondRetAmount' :value='formItem.customBondRetAmount' />
      <f-form-item label='退保证金款银行' name='customBondRetBankName' :value='formItem.customBondRetBankName' />
      <f-form-item label='退保证金款账户' name='customBondRetBankNo' :value='formItem.customBondRetBankNo' />

      <a-divider orientation='left' style='color: blue;font-weight: bold'>部门结算金额</a-divider>
      <f-form-item label='部门结算金额' type='number' :precision='2' data-type='number' name='deptSettleAmount' :value='formItem.deptSettleAmount' />
      <f-form-item label='部门结算支付金额' type='number' :precision='2' data-type='number' name='deptSettlePayAmount' :value='formItem.deptSettlePayAmount' />
      <f-form-item label='部门结算支付日期' type='date' name='deptSettlePayDate' :value='formItem.deptSettlePayDate' />

      <a-divider orientation='left' style='color: blue;font-weight: bold'>发票信息</a-divider>
      <f-form-item label='渠道商发票号' name='settleInvoiceNo' :value='formItem.settleInvoiceNo' />
      <f-form-item label='渠道商开票金额' name='settleInvoiceAmount' :value='formItem.settleInvoiceAmount' />
      <f-form-item label='渠道商开票日期' type='date' name='settleInvoiceDate' :value='formItem.settleInvoiceDate' />
      <f-form-item label='商务经理发票号' name='settleInvoiceNoD' :value='formItem.settleInvoiceNoD' />
      <f-form-item label='商务经理开票金额' name='settleInvoiceAmountD' :value='formItem.settleInvoiceAmountD' />
      <f-form-item label='商务经理开票日期' type='date' name='settleInvoiceDateD' :value='formItem.settleInvoiceDateD' />
      <f-form-item label='片区服务商发票号' name='settleInvoiceNoC' :value='formItem.settleInvoiceNoC' />
      <f-form-item label='片区服务商开票金额' name='settleInvoiceAmountC' :value='formItem.settleInvoiceAmountC' />
      <f-form-item label='片区服务商开票日期' type='date' name='settleInvoiceDateC' :value='formItem.settleInvoiceDateC' />
      <f-form-item label='商务总负责人发票号' name='settleInvoiceNoE' :value='formItem.settleInvoiceNoE' />
      <f-form-item label='商务总负责人开票金额' name='settleInvoiceAmountE' :value='formItem.settleInvoiceAmountE' />
      <f-form-item label='商务总负责人开票日期' type='date' name='settleInvoiceDateE' :value='formItem.settleInvoiceDateE' />
      <a-divider orientation='left' style='color: blue;font-weight: bold'>市场结算金额</a-divider>
      <f-form-item label='渠道商结算金额' type='number' :precision='2' data-type='number' name='settleAmount' :value='formItem.settleAmount' />
      <f-form-item label='渠道商结算支付金额' type='number' :precision='2' data-type='number' name='payAmount' :value='formItem.payAmount' />
      <f-form-item label='渠道商结算支付日期' type='date' name='payDate' :value='formItem.payDate' />
      <f-form-item label='商务经理结算金额' type='number' :precision='2' data-type='number' name='settleAmountD' :value='formItem.settleAmountD' />
      <f-form-item label='商务经理结算支付金额' type='number' :precision='2' data-type='number' name='payAmountD' :value='formItem.payAmountD' />
      <f-form-item label='商务经理结算支付日期' type='date' name='payDateD' :value='formItem.payDateD' />
      <f-form-item label='片区服务商结算金额' type='number' :precision='2' data-type='number' name='settleAmountC' :value='formItem.settleAmountC' />
      <f-form-item label='片区服务商结算支付金额' type='number' :precision='2' data-type='number' name='payAmountC' :value='formItem.payAmountC' />
      <f-form-item label='片区服务商结算支付日期' type='date' name='payDateC' :value='formItem.payDateC' />
      <f-form-item label='商务总负责人结算金额' type='number' :precision='2' data-type='number' name='settleAmountE' :value='formItem.settleAmountE' />
      <f-form-item label='商务总负责人支付金额' type='number' :precision='2' data-type='number' name='payAmountD' :value='formItem.payAmountD' />
      <f-form-item label='商务总负责人支付日期' type='date' name='payDateD' :value='formItem.payDateD' />
      <a-divider orientation='left' style='color: blue;font-weight: bold'>利润金额</a-divider>
      <f-form-item label='部门利润' type='number' :precision='2' data-type='number' name='deptProfitAmount' :value='formItem.deptProfitAmount' />
      <f-form-item label='公司利润' type='number' :precision='2' data-type='number' name='profitAmount' :value='formItem.profitAmount' />
      <f-form-item label='税收利润' type='number' :precision='2' data-type='number' name='taxProfitAmount' :value='formItem.taxProfitAmount' />
      <f-form-item label='产品利润' type='number' :precision='2' data-type='number' name='drugProfitAmount' :value='formItem.drugProfitAmount' />
      <f-form-item label='边际利润' type='number' :precision='2' data-type='number' name='bjProfitAmount' :value='formItem.bjProfitAmount' />
      <f-form-item label='支付开票税金' type='number' :precision='2' data-type='number' name='payInvoiceTaxAmount' :value='formItem.payInvoiceTaxAmount' />
      <f-form-item label='校验' type='number' :precision='2' data-type='number' name='checkAmount' :value='formItem.checkAmount' />
    </f-form>
  </div>
</template>
<script>
import api from "../../js/api"

export default {
  name: "HyOrderCalculateDept",
  props: {},
  data() {
    return {
      refs: this.$refs,
      loadDept: false,
      api: Object.assign(api, this.api),
      isAdd: true,//是否是添加模式
      loaded: false,//是否加载完成
      formItem: this.getFormItem(),
      disabled: false
    }
  },
  methods: {
    getFormItem() {
      return {
        orderId: "",
        orderNo: "",
        delivery: "",
        sendType: "",
        saleManName: "",
        customName: "",
        settleRate: "",
        invoiceSendType: 0,
        reputation: "",
        reputationAmount: "",
        bankId: "",
        settleType: 0,
        customBondType: 0,
        supplierBondType: 0,
        customId: "",
        billsType: "",
        remark: ""
      }
    },
    //表单赋值
    setData(data) {
      this.$refs.form.resetFields()
      this.formItem = this.getFormItem()
      if (data && data.orderDetailsId) {
        if (data.orderState == 2) {
          this.disabled = true
        }
        this.http.get(this, {
          url: this.api.hyOrderDetails.get,
          params: {
            orderDetailsId: data.orderDetailsId,
            handlerName: "hyCalCulateTab1GetHandler"
          },
          success: function(me, data) {
            me.formItem = data
          }
        })

      }
    },

    //提交表单
    handleSubmit(callback) {
      this.$refs.form.submit({ orderDetailsId: this.formItem.orderDetailsId }, callback)
    }
  },
  mounted() {

  },
  created() {
  },
  components: {}
}
</script>

<style scoped lang='less' rel='stylesheet/less'>

</style>
